#include <stdio.h>
#include <signal.h>
 
void sigint_handler(int sig) {
  printf("Received SIGINT signal\n");
}
 
int main() {
  if (signal(SIGINT, sigint_handler) == SIG_ERR) {
    perror("signal");
    return 1;
  }
 
  printf("Waiting for SIGINT signal...\n");
 
  pause();

  return 0;
}